Update the camera calibration app with the visualization of the lens distortion#1918
Update the camera calibration app with the visualization of the lens distortion#1918s-trinh wants to merge 14 commits intolagadic:masterfrom
Conversation
…ults for the camera calibration app.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1918 +/- ##
==========================================
- Coverage 48.68% 48.41% -0.27%
==========================================
Files 532 532
Lines 69293 69334 +41
Branches 32403 32441 +38
==========================================
- Hits 33735 33569 -166
- Misses 24976 31507 +6531
+ Partials 10582 4258 -6324 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… lower extremities of the image.
…e image center (in green) and the camera principal point (in red) in the distortion displacement map image.
d38bc19 to
971d67a
Compare
…e current image resolution.
a65f1c6 to
b965d26
Compare
…_poses' while adding section
… the delete code when the program exits. OpenCV 4 requires C++11. Moreover, the code cannot build as is: - "vpDisplay *d = nullptr;" is declared here: https://github.com/lagadic/visp/blob/fe9b308254dd520c3460e8a7fb4862dd6170cb32/apps/calibration/intrinsic/visp-calibrate-camera.cpp#L125 - but at multiple location "delete display;" is done: https://github.com/lagadic/visp/blob/fe9b308254dd520c3460e8a7fb4862dd6170cb32/apps/calibration/intrinsic/visp-calibrate-camera.cpp#L721
…jection error graph.
4079323 to
85c785b
Compare
|
The PR is ready.
visp/apps/calibration/intrinsic/visp-calibrate-camera.cpp Lines 124 to 126 in fe9b308 The declared variable is visp/apps/calibration/intrinsic/visp-calibrate-camera.cpp Lines 701 to 705 in fe9b308 At multiple locations I have added a graph with uv-reprojection errors: |
|
@s-trinh It makes sense to not support c++98 |
|
@s-trinh Can you add the 2 images that are missing in the doc: |
|
@fspindle I have added the missing images. Also, by default now the initial camera focal length is scaled by the image size: double scale = I.getWidth() / 640.0;
double px = opt_use_focal_cmd_line ? opt_init_focal : scale * cam_init.get_px();
double py = opt_use_focal_cmd_line ? opt_init_focal : scale * cam_init.get_py(); |
f436431 to
7366c7c
Compare
37dae4e to
d4d6a74
Compare
# Number of inner corners per a item row and column. (square, circle)
BoardSize_Width: 18
BoardSize_Height: 9
# The size of a square in meters
Square_Size: 0.02
# The type of pattern used for camera calibration.
# One of: CHESSBOARD or CIRCLES_GRID
Calibrate_Pattern: CHARUCOBOARD
# The input image sequence to use for calibration
Input: pycalib/data/charuco/%08d.jpg
# Tempo in seconds between two images. If > 10 wait a click to continue
Tempo: 1
# ChArUco
Charuco_Marker_Size: 0.015
Charuco_Dictionary: DICT_4X4_250
Charuco_Legacy_Pattern: 0
|
…ing limitation: the full board needs to be visible in the image. Update the camera calibration tutorial with a section with comparison between OpenCV and ViSP calibration for wide-angle lens.
0bb0ad5 to
9eb9fab
Compare









The chessboard calibration pattern is obsolete since the whole board must be detected and it does not allow to have points at the extremities of the image, which is crucial for correct lens distortion modelling.
This is what would give a classical images acquisition:
But this is what is fed to the calibration procedure:
With the first image in background, to check that the pattern occupancy is correct:
Some alternatives that are widely used are:
See also the DLR CalDe for advices about the procedure (e.g. oblique images are crucial, big calibration board in the image, ...):
Previous PR: #1063
Following are some results on ViSP and additional calibration images found on the Net.
./visp-calibrate-camera default-chessboard.cfg --save
./visp-calibrate-camera default-circles.cfg --save
Dataset 1
Canon 6D Lens Canon 35mm
Canon 6D Lens Canon Ultrasonic Macro 24-105mm
mosaics_reproj_err_with_dist_0000

mosaics_undist_0000

Canon PowerShot SX130
Update: fixed by scaling the initial focal length by the current image resolution
Canon 40D Lens Canon 28-90mm
GoPro
More distortion coefficients are needed.
mosaics_reproj_err_with_dist_0000

mosaics_undist_0000

Nikon D3200 Lens Nikon DX 18-105mm
mosaics_reproj_err_with_dist_0000

mosaics_undist_0000

OnePlus X
Update: fixed by scaling the initial focal length by the current image resolution
RaspberryPi